using System;
using System.Collections.Generic;

namespace AHWrapper{
	public class Location{
		public string name;
		public string region;
		public bool closed;
		public bool stable;
		public Location[] adjacent;
		public List<Mons> monsts;
		public List<Investigator> players;
		public Gate openGate; 
		
		public Location(){
		}
		
		public Location(string locname, string regname){
			name=locname;
			region=regname;	
			closed=false;
			monsts = new List<Mons>();
			players = new List<Investigator>();
			adjacent = new Location[8];
			
			
			
		}
		
		public void addInvestigator(Investigator character){
			players.Add(character);
		}
		
		public void removeInvestigator(Investigator character){
			players.Remove(character);
		}
		
		
		public string getName(){
			return name;
		}
		
		public bool isOccupied(){
			if(monsts.Count>0) return true;
			else return false;	
		}
		
		public Mons getOccupant(){
			if(monsts.Count>0){
				return monsts[0];
			}else{
				return null;
			}
		}
		
		public Mons getOccupant(int pIndex){
			return monsts[pIndex];
		}
		
		public void removeOccupant(Mons pOccupant){
			monsts.Remove(pOccupant);
		}
		public Mons removeOccupant(int pIndex){
			Mons retMon=monsts[pIndex];
			monsts.RemoveAt(pIndex);
			return retMon;
		}
		
		public void addOccupant(Mons pOccupant){
			monsts.Add(pOccupant);
		}
		
		public bool addGate(Gate pGate){
			if(openGate==null){
				openGate=pGate;
				return true;
			}else{
				return false;
			}
		}
		
		public bool isGate(){
			if(openGate!=null){
				return true;
			}else return false;
		}
		
		public int occupantCount(){
			return monsts.Count;
		}

		
	}
}